let arr = ["B3", "D2", "F1", "A9", "D12", "A2", "C1", "Z0", "B1"]
let mySort = (arr) => {
    let map = {}
    let result = []
    arr.sort().forEach(item => {
        if (item[0] in map) {
            map[item[0]].push(item[1])
        } else {
            map[item[0]] = [item[1]]
        }
    })
    for (let i in map) {
        map[i].forEach(item => {
            result.push(i + item)
        })
    }
    return result
}
console.log(mySort(arr))